package com.dsz.entity;


import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@Entity
@Table(name="t_modules")
@GenericGenerator(name="sys-uuid",strategy="uuid")
public class Modules {
	
	@Id
	@GeneratedValue(generator="sys-uuid")
	private Integer mid;
	private String mname;
	private Integer parentID;
	private String path;
	private Integer weight;
	private String ops;
	private String inte;
	
	@ManyToMany(fetch=FetchType.LAZY,mappedBy="ms")
	@JsonIgnoreProperties("ms")
	private Set<Roles> rs = new HashSet<>();

	public Modules(Integer mid, String mname, Integer parentID, String path, Integer weight, String ops, String inte) {
		this.mid = mid;
		this.mname = mname;
		this.parentID = parentID;
		this.path = path;
		this.weight = weight;
		this.ops = ops;
		this.inte = inte;
	}

	public Modules() {
	}
	

	public Integer getMid() {
		return mid;
	}

	public void setMid(Integer mid) {
		this.mid = mid;
	}

	public String getMname() {
		return mname;
	}

	public void setMname(String mname) {
		this.mname = mname;
	}

	public Integer getParentID() {
		return parentID;
	}

	public void setParentID(Integer parentID) {
		this.parentID = parentID;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public Integer getWeight() {
		return weight;
	}

	public void setWeight(Integer weight) {
		this.weight = weight;
	}

	public String getOps() {
		return ops;
	}

	public void setOps(String ops) {
		this.ops = ops;
	}

	public String getInte() {
		return inte;
	}

	public void setInte(String inte) {
		this.inte = inte;
	}

	public Set<Roles> getRs() {
		return rs;
	}

	public void setRs(Set<Roles> rs) {
		this.rs = rs;
	}

	@Override
	public String toString() {
		return "Modules [mid=" + mid + ", mname=" + mname + ", parentID=" + parentID + ", path=" + path + ", weight="
				+ weight + ", ops=" + ops + ", inte=" + inte + ", rs=" + rs + "]";
	}
	
	
}












